function timer(statusFlag, intDiff){
	window.setInterval(function(){
	var day=0,
		hour=0,
		minute=0,
		second=0;//时间默认值		
	if(intDiff > 0){
		day = Math.floor(intDiff / (60 * 60 * 24));
		hour = Math.floor(intDiff / (60 * 60)) - (day * 24);
		minute = Math.floor(intDiff / 60) - (day * 24 * 60) - (hour * 60);
		second = Math.floor(intDiff) - (day * 24 * 60 * 60) - (hour * 60 * 60) - (minute * 60);
	}
//	   if (minute <= 9) minute = '0' + minute;
//	   if (second <= 9) second = '0' + second;
//	   $('#day_show').html(day+"天");
//	   $('#hour_show').html('<s id="h"></s>'+hour+'时');
//	   $('#minute_show').html('<s></s>'+minute+'分');
//	   $('#second_show').html('<s></s>'+second+'秒');
// 	if(day){
// 		hour += day * 24;
// 	}

	var str = '';

	if(statusFlag == 2){
		str += '距开售 还剩';
	}else{
		str += '距结束 还剩';
	}

	if(day){
		str += '<i class="mc-num">'+day+'</i><span class="mc-text">天</span>';
	}
	if(hour){
		str += '<span></span><i class="mc-num">'+hour+'</i><span class="mc-text">小时</span>';
	}
	str += '<i class="mc-num">'+minute+'</i><span class="mc-text">分</span>';
	str += '<i class="mc-num">'+second+'</i><span class="mc-text">秒</span>';
	
	$('#J_remainTime').html(str);
	intDiff--;
	}, 1000);
}

$(function(){
	if(statusFlag == 2){
		var intDiff = parseInt(start_time - nowtime);//倒计时总秒数量
		timer(statusFlag, intDiff);
	}else if(statusFlag == 1){
		var intDiff = parseInt(end_time - nowtime);//倒计时总秒数量
		timer(statusFlag, intDiff);
	}else{
		$('#J_remainTime').html('活动已结束');
	}
});